<?php

/**
 * actionwf filter form base class.
 *
 * @package    forumCDE
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseactionwfFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'owner_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('owner'), 'add_empty' => true)),
      'description'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ordre'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'etatorigine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatorigine'), 'add_empty' => true)),
      'etatdestine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatdestine'), 'add_empty' => true)),
      'role_id'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('role'), 'add_empty' => true)),
      'commentaire'            => new sfWidgetFormFilterInput(),
      'debuttraitement'        => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fintraitement'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fermetechnique'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'ferme'                  => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'recalculedelai'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'readonly'               => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'commentaireobligatoire' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'icon'                   => new sfWidgetFormFilterInput(),
      'visibilite'             => new sfWidgetFormFilterInput(),
      'addattach'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'externaliser'           => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'signature'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fieldsmodif_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('fieldsmodif'), 'add_empty' => true)),
      'sansmails'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'rolesnotification'      => new sfWidgetFormFilterInput(),
      'messageclient'          => new sfWidgetFormFilterInput(),
      'clientmail_id'          => new sfWidgetFormFilterInput(),
      'mailvalideur_id'        => new sfWidgetFormFilterInput(),
      'mailnotification_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('mailnotification'), 'add_empty' => true)),
      'dossierautomatique_id'  => new sfWidgetFormFilterInput(),
      'messageutilisateur'     => new sfWidgetFormFilterInput(),
      'created_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'owner_id'               => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('owner'), 'column' => 'id')),
      'description'            => new sfValidatorPass(array('required' => false)),
      'ordre'                  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'etatorigine_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('etatorigine'), 'column' => 'id')),
      'etatdestine_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('etatdestine'), 'column' => 'id')),
      'role_id'                => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('role'), 'column' => 'id')),
      'commentaire'            => new sfValidatorPass(array('required' => false)),
      'debuttraitement'        => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fintraitement'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fermetechnique'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'ferme'                  => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'recalculedelai'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'readonly'               => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'commentaireobligatoire' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'icon'                   => new sfValidatorPass(array('required' => false)),
      'visibilite'             => new sfValidatorPass(array('required' => false)),
      'addattach'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'externaliser'           => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'signature'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fieldsmodif_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('fieldsmodif'), 'column' => 'id')),
      'sansmails'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'rolesnotification'      => new sfValidatorPass(array('required' => false)),
      'messageclient'          => new sfValidatorPass(array('required' => false)),
      'clientmail_id'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mailvalideur_id'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'mailnotification_id'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('mailnotification'), 'column' => 'id')),
      'dossierautomatique_id'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'messageutilisateur'     => new sfValidatorPass(array('required' => false)),
      'created_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('actionwf_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'actionwf';
  }

  public function getFields()
  {
    return array(
      'id'                     => 'Number',
      'owner_id'               => 'ForeignKey',
      'description'            => 'Text',
      'ordre'                  => 'Number',
      'etatorigine_id'         => 'ForeignKey',
      'etatdestine_id'         => 'ForeignKey',
      'role_id'                => 'ForeignKey',
      'commentaire'            => 'Text',
      'debuttraitement'        => 'Boolean',
      'fintraitement'          => 'Boolean',
      'fermetechnique'         => 'Boolean',
      'ferme'                  => 'Boolean',
      'recalculedelai'         => 'Boolean',
      'readonly'               => 'Boolean',
      'commentaireobligatoire' => 'Boolean',
      'icon'                   => 'Text',
      'visibilite'             => 'Text',
      'addattach'              => 'Boolean',
      'externaliser'           => 'Boolean',
      'signature'              => 'Boolean',
      'fieldsmodif_id'         => 'ForeignKey',
      'sansmails'              => 'Boolean',
      'rolesnotification'      => 'Text',
      'messageclient'          => 'Text',
      'clientmail_id'          => 'Number',
      'mailvalideur_id'        => 'Number',
      'mailnotification_id'    => 'ForeignKey',
      'dossierautomatique_id'  => 'Number',
      'messageutilisateur'     => 'Text',
      'created_at'             => 'Date',
      'updated_at'             => 'Date',
    );
  }
}
